

%1
x = 1:0.01:3;
y1 = x.^3;
y2 = sin(x);
plot(x,y1,'r',x,y2,'b')
grid on

x = 1:0.01:3;
y1 = x.^3;
y2 = sin(y1);
plot(x,y2)
hold on
plot(x,y1)
grid on


%2
rectangle('position',[10-5,10-5,10,10],'curvature',[1,1],'edgecolor','r')
hold on
rectangle('position',[-20 -10 40 20],'edgecolor','g','linewidth',2)
hold on
x = round(rand(1,3) * 10);
y = round(rand(1,3) * 10);

for i = 1:length(x)
    for j = 1:length(y)
        
            
             line([x(i),x(j)],[y(i),y(j)],'linewidth',2);
             
             hold on;
     
    end
end


plot(x,y)
r = 10;
a = 20;
b = 30;
t = 0:0.01:2.1*pi;
x = a + r*cos(t);
y = b + r*sin(t);
plot(x,y)
axis equal

%3
x = -3:0.01:3;
y1 = 2*x + 3;
y2 = x.^2 + 3*x + 6;
subplot(3,2,1),plot(x,y1)
title('子图一');
xlabel('时间');
ylabel('价格');
legend_Fontsize1 = legend('y1');
set(legend_Fontsize1,'fontsize',5);
grid on
subplot(3,2,2),plot(x,y2)
title('子图二');
xlabel('时间');
ylabel('价格');
legend_Fontsize2 = legend('y2');
set(legend_Fontsize2,'fontsize',5);
grid on


%4
z = peaks(40);
mesh(z);
meshc(z);
surf(z)


x = linspace(0,0.001,90);
y = x;
[X,Y] = meshgrid(x,y);
Z = X.^2 + Y.^8 + sin(X*Y);
Fig = surfc(X,Y,Z);

%5
t=0:pi/20:2*pi;
x=0.5*sin(t);
y=0.5*cos(t);
plot(x,y);
theAxes=axis;
fmat=moviein(20);
for j=1:99
    text(-0.2,0,num2str(100-j),'FontSize',144,'Color','red')
    axis(theAxes)
    fmat(:,j)=getframe;h=get(gca,'children');
    delete(h(1));
end
movie(fmat,10)

r = 10;
a = 30;
b = 30;
t = 0:0.01:2.1*pi;
x = a + r*cos(t);
y = b + r*sin(t);
plot(x,y)
b1 = text(30,30,'99','fontsize',40,'color','r');
pause(3);
b2 = text(30,30,'98','fontsize',40,'color','r');
pause(3);


